package account.webapi;

public enum AppErrorCode {
    UNDEFINED("0", "Undefined"),
    BAD_REQUEST("400", "Bad Request"),
    PERMISSION_DENIED("403", "Permission denied"),
    FORBIDDEN("403", "Forbidden"),
    NOT_FOUND("404", "Not found"),
    METHOD_NOT_ALLOWED("405", "Method not allowed"),
    GENERIC_RUNTIME_ERROR("500", "Generic runtime error"),
    OTHER_UNEXPECTED_RUNTIME_ERROR("1000", "Other unexpected runtime error");

    private final String type;

    private final String code;

    AppErrorCode(String code, String type) {
        this.code = code;
        this.type = type;
    }

    @Override
    public String toString() {
        return String.format("%s: %s", code, type);
    }
}
